package com.diy.sigmund.diyuser.test.controller;

import com.diy.sigmund.diycommon.entity.ResultMsg;
import com.diy.sigmund.diycommon.entity.enumerate.AccessLimitTypeEnum;
import com.diy.sigmund.diycommon.spring.anno.AccessLimit;
import com.diy.sigmund.diycommon.spring.anno.IgnoreTokenVerification;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ylm-sigmund
 * @since 2021/8/17 12:04
 */
@RestController
@RequestMapping("/user/accessLimit")
public class AccessLimitController {

    // @IgnoreTokenVerification
    // @AccessLimit
    @AccessLimit(accessLimitType = AccessLimitTypeEnum.IP)
    @PostMapping("/testAccessLimit")
    public ResultMsg testAccessLimit(HttpServletRequest req) {
        return ResultMsg.success("AccessLimit ok");
    }
}
